package design.power;

public class UsersFactory {
	public static Users getUser(String identity) throws Exception{
		if(identity.equalsIgnoreCase("Student")){
			return new Student();
		}
		else if(identity.equalsIgnoreCase("Admin")){
			return new Admin();
		}
		else
			throw new Exception("身份错误");
	}
}	
